//隐患
import React from 'react'
import '../../../css/oper_inspertion/yinhuan.less'
import { Space, Table, Tag } from 'antd';
import type { TableProps } from 'antd';
interface DataType {
    key?: string;
    name?: string;
    rusule?: string;
    address?: string;
    timer?: string;
}
const columns: TableProps<DataType>['columns'] = [
    {
        title: '工程',
        dataIndex: 'name',
        key: 'name',
        render: (text) => <a>{text}</a>,
    },
    {
        title: '检查部位',
        dataIndex: 'rusule',
        key: 'rusule',
    },
    {
        title: '检查结果',
        dataIndex: 'address',
        key: 'address',
        render: (text) => {
            return (
                <Space size="middle"  >
                    <Tag color={text === '正常' ? 'green' : 'volcano'} key={text}>
                        {text}
                    </Tag>
                </Space>
            )
        },
    },
    {
        title: '检查时间',
        key: 'timer',
        dataIndex: 'timer',
    },

];

const data: DataType[] = [
    {
        key: '1',
        // name: 'John Brown',
        rusule: "点位1",
        address: '正常',
        timer: '2022-05-20 15:00',
    },
    {
        key: '2',
        name: '船闸',
        rusule: "点位2",
        address: '正常',
        timer: '2022-05-20 15:00',
    },
    {
        key: '3',

        rusule: "点位3",
        address: '隐患',
        timer: '2022-05-20 15:00',
    },
    {
        key: '4',
        // name: '潜水闸',
        rusule: "点位4",
        address: '正常',
        timer: '2022-05-20 15:00',
    },
    {
        key: '5',
        // name: '泵房',
        rusule: "点位5",
        address: '正常',
        timer: '2022-05-20 15:00',
    },
    {
        key: '6',
        name: '潜水闸',
        rusule: "点位6",
        address: '隐患',
        timer: '2022-05-20 15:00',
    },
    {
        key: '7',
        // name: '潜水闸',
        rusule: "点位7",
        address: '正常',
        timer: '2022-05-20 15:00',
    },
    {
        key: '8',
        // name: '泵房',
        rusule: "点位8",
        address: '隐患',
        timer: '2022-05-20 15:00',
    }
];

const yinhuan: React.FC = () => {
    return (
        <div className='yinhuan'>
            <Table<DataType>
                columns={columns}
                dataSource={data}
                pagination={false}
                className='yinhuan_table'
            />
        </div>
    )
}

export default yinhuan
